package com.hexgon.plugins.rabbitmq;

import org.springframework.boot.autoconfigure.amqp.RabbitProperties;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotBlank;
import java.util.HashMap;
import java.util.Map;

/**
 * 多 RabbitMQ源 配置
 * @author: XuZhibin
 * @date: 2023/11/12 14:06
 * @version: v1.0
 * @attention:
 */
@Validated
@Component
@ConfigurationProperties(prefix = "rabbitmq")
public class MultiRabbitProperties {

    @NotBlank(message = "必须配置默认的RabbitMQ源")
    private String defaultRabbit;

    /**
     * 需要排除得RabbitMQ, 多个用 , (英文逗号)做分隔符
     */
    private String excludeRabbits;

    /**
     * 需要排除自动启动的监听队列名称
     */
    private String excludeQueueNames;

    /**
     * 打印autoStartup为true的监听器， 默认：false
     */
    private Boolean showActiveListenerDetails = false;

    private Map<String, RabbitProperties> collections = new HashMap<>();

    public String getDefaultRabbit() {
        return defaultRabbit;
    }

    public void setDefaultRabbit(String defaultRabbit) {
        this.defaultRabbit = defaultRabbit;
    }

    public String getExcludeRabbits() {
        return excludeRabbits;
    }

    public void setExcludeRabbits(String excludeRabbits) {
        this.excludeRabbits = excludeRabbits;
    }

    public Map<String, RabbitProperties> getCollections() {
        return collections;
    }

    public void setCollections(Map<String, RabbitProperties> collections) {
        this.collections = collections;
    }

    public String getExcludeQueueNames() {
        return excludeQueueNames;
    }

    public void setExcludeQueueNames(String excludeQueueNames) {
        this.excludeQueueNames = excludeQueueNames;
    }

    public Boolean getShowActiveListenerDetails() {
        return showActiveListenerDetails;
    }

    public void setShowActiveListenerDetails(Boolean showActiveListenerDetails) {
        this.showActiveListenerDetails = showActiveListenerDetails;
    }
}
